add Note support and begin refactor