move common code to note-service