minor if stmt refactor