Refactored sort handler class so it uses external comparators instead of local methods for different sorting options