moved inner classes to normal classes