moved all of the module specific code into /lib classes so they can be used in multiple views