Separated out some of the code to different packages