refactor metrics control