Refactoring some ticket and token inserts