Use a case statement

Signed-off-by: David Celis <me@davidcel.is>