Make the "ticket" function return codes clearer