Changed file structure and refactored a few things