Removed the inner classes and made them subclasses, at @psav 's suggestion (good one)