Move scrolling into switch