Updates to allow complex queries