refactor tickets controller