DiD S12: used [switch] instead of multiple [if]s where applicable