refactor to file structure