refactored ticket example