Cleanup, add comments.
Only use the server to do the nested query.