General clean up, introduce more variables, move file structure about