Refactored using .select and .sort