updated functions to call limited DB queries