a bit of refactor on the main planner call...