Caret inside note spec and small refactoring of insideNote