refactoring to address violation that if statements should always use braces