improve generic converting