remove unnecssary parens and make if statements idiomatic