Update query generation to be consistent across helpers