Refactored UOW with the generic graph sorter