Moved note stuff to its own class.