modify order of functions in enhancement