added cleaner and better logging