Use each_with_object({}) instead in place of inject({}) when appropriate