clean up of an if statement