refactored getLevelScore calculation