refactoring
new document changes listener policy
new document changes listener policy
some more refactoring