Refactored and added the attribute orderBy