rename encoding file
Refactor comments, use constants where possible