cleaning up the service to not have as much repeated code