Refactor note-taking functions