query op sort formatting

order fields, fix logging statements, other small style changes