Improve encoder coding style