variables: factorize the callback code, using a special function.