first round of changes to add support for attribute queries