Move adapt into utils