refactor metricnotify