Move code to where it belongs