Clean up some switch statements