implemented query utility