Make code more python-like

Remove uneeded parens.
Use only one underscore.
Remove repetitive statements.

Change-Id: Ifbb600bc61a978eb729bf97302b6f850625ecb0d