added functionality for queries generation