Fix typo in class name Encoding.
Major reformatting of the code.