refactor planning