address review comments

* inline some methods
* refactor enc/dec classes
* modify docs