Extract method to simplify querying