File refactoring