add cleaner function and deleted extra code