Refactor: Use #each_with_object instead of #inject.