use function overloading to dispatch