Clean up sql queries in reports model