clean up the SQL