Pull out functionality of modules into their own files