refactoring graph, applying SLAP to the query engine