more robust block type switch