encoder factory and example update