Cleaned up the switch statements