Added logging to cleaning function.