refactoring ticket-system