Factor out switch actions into own functions
Implement complete customizable switch action