Since ChatGPT put me to shame, here's how I would refactor this with dbt: 1. Create a lookup table of keywords and categories 2. Write a dbt model to autogenerate the SQL by looping through this lookup table