js: Make query construction easier to read