Cumbersome if statement