I think the following case statements could be removed as these fall through to default anyway.