Type safety in dispatcher (wip)