Conditional statement with side effect.... consider refactoring?