Revised inner classes. v1
Revised inner classes. v1
Factories changed by using inner classes