Isolated Sort filter generation in Sort class to be reused.