Refactoring code to multiple files