Remove trailing white-spaces and fix indentation
Replace lower-camel-cased method names to snake-cased
Simplify object state management