Implement proxy ticket validation and related refactoring.