refactor performance calculations into service layer