Remove redundant code from research_output queries.