moved metrics related code to a dedicated package