Move switcher handlers into separate functions