refactor the service a little