less resource use with if statement