Refactoring the input_student method