cleanup and plan