Move typeid call to separate function.