more compact case statement