A switch statement here would look more elegant, but obviously just a nit.