cleaned up switch statements