Refactor to different files