`ren` doesn't mean anything to me. What is this variable? Looking around elsewhere in this pull request I see that it's a "renewal" field. Better to have descriptive names (e.g. `renewal_date`) instead of `ren_query`, which isn't entirely obvious.