Refactoring, better file structure