Move more logic out of validator into the planner