Remove some methods and add encoding attribute.