fix slow document update

update ratification accepted cache before save
code cleanup