move queries from views to controllers