refactor metrics into its own service.