reduce 'for' loop, make decoding faster