add generic sort method architecture