Data compression and other optimizations