Created nested classes. Removed some useless headers.