refactor to new plan