adapt functions