You have perfect timing. I'm working on a site that uses a backported version of ATS. I was having a bugger of time with a huge batch of nested if/elses in a master template. I grabbed the switch code (and another supporting proc) and things cleaned up nicely.