refactoring
refactoring. Improving sorting with scopes.