Refactored with embedded student count variable