Version counter now increases by document version

+ remove unused code