clean up and refactoring plan