Optimizations to make saved file size smaller