Refactor sorts and get indexed results.