Refactor condition evaluation a bit to make things clearer.