Wouldn't this be simpler as an if block?