[IMP]planner: improve code.