Consolidate switch statements.