refactored student count