refactoring. extarct each metric into separate file