Separated classes into files, further refactoring