Move cleaner process collection as late as possible in the function