refactor and organize file structure