use function declaration according to the context