Move SQL to the Controller complete