Refactored IndirectCodec and integrated it into CodecContainer