Extract inner classes to top level