Extract inner classes to work around buggy 1.3 JRE and thus keep 1.3 compatibility. Patch provided by Adrian Cumiskey (bugzilla #43156).