cleanup encoder
Merge pull request #7 from andreineculau/master

Clean up encoder