improv: make the conditional check more generic