Remove redundant variable assignments.
Simpler 'if' statement.
Remove unused variable.