Much cleaner query manipulation, more DRY.