Move code into source file