Refactored code and introduced variable student_count