Tidy up main file