Some file refactoring