everything works now after the switch. BUT this solution is ugly, we need to trigger template instantiation explicitly