single document instance update, refactoring + logic fixes