Renamed some methods and moved classes to their own files.