This particular join statement seems to happen multiple times in this module. Would it make sense to make it a module-level constant?