Create codec in correct scope to prevent decoding state collision