Remove unused code
Added encoding feature.