Clean function updated