cleaner writer implementation