decoder was divided in decoder and smart_decoder