Refactoring and adding QueryData object type to make using results easier