cleanup and for parallel working