Refactor used and invalid ticket requirment