make refactorization of planner