cleanup and simplified the SQL schema a bit.