query and method implementation.