Further adaption of detour template class