refactoring into multiple files