Adapter and sort methods refactor