fix OCLint warning: short variable name, unused parameter
collapse if statement
commit another if statement
remove constant conditional operator
add missing break