Refactored teacher name functionality for notes