refactored replacing code with @students