refactoring variable name to match naming conventions
collapsing if statements