refactoring to file structure