Added a query_builder function to the Realm Class to increase code reuse