Switching logic.