Moving state to a service instead of the controller