starting to refactor
refactorig is about done
Improved handling of special characters in note