cleaned up an if statement