use function type inference to simplify wrapper implementation