add revisions cleanup and other optimizations