changes to the cleaning functions