Simplify the cleaning code.