Externalized the SQL queries.