[WIP] Re-factoring planner module.