Refactored route validation