some refactoring to use Metric objects in more places