Refactoring and removing unnecessary files