factorize exec callback