Inner Classes: using anonymous inner classes in Factories