made toVirtual a teplate function