Better handling of switches