Improved switch macros