Move work into a struct with functions and put in a different file