Planner refactor