switched inner classes to methods