Moves to use promises which allows both direct and deferred queries and compare methods