refactored and removes some useless bits of code in directory#add_student