remove old buffer style approach to encoding