Make code prettier by chaining the call to query