Replace if elif... with case statement