refactored NoteElement equality and hashcode