move switch task to its own file