Added '?' to query functions. Made query functions private.