Refactor encoder generator.
Update benchmarks.