Refactored select functions