Further multi-file refactoring