Move code into separate files