Better representation of results from query to support joins properly