refactored playlist query functions