Refactored student count