Simplify the code in enhance().