Clean up some SonarQube warnings in `service' directory.