I'm not sure how I feel about having these `cc_type` checks inside the `case`. It lets me completely remove the code duplication, so I think it's worth it, even though it feels weird.