Cleanup the code (fixing mostly indentation issues reported by pycharm)