utility to switch for condition