Mostly just re-arranging code in file