replace deprecated code
remove unused and useless code

* unused variables
* useless return and self
* redundant curly braces
do not use :: for method calls
align the parameters of a method call
add space to comment