Splitting out logic for generation of fields to be selected in queries.