refactor ticket model