Added toQueryParams method