refactored CRM calculation