Optimizations to decoding