move extend() to utils