inject encoder_factory service