modify as_liquid to use case statement