Changing objects to use the module pattern