Refactoring and reorganizing files