improved DAO ability to habdle different query types