refactor sortData method