stringly typing makes me sad. Perhaps the caller should just pass the necessary function?