Refactor and move files