todo: review Note.scala from snippets and take the good parts