refactor validate route