Refactored planner from orchestrator