Reducing scope of sortResult.