Moves some of the logic from the controller to the service.  Adds some minor styling.