updated with support for metrics type