Switch implementation.