Move around code to more sensible positions