if statement can be simplified