Move queries to a single line if they will fit