optimized decoding