support for delta encoding and some other optimizations