some progress on QueryFactory
associations working and query being expanded