adapt for names as a free function