Minor refactoring. No real code changes
minor refactoring for easier reading of editTeacher function in teacher.js