refactored calcScore module