a little condition refactor