Updated some db table names and pulled "magic numbers" out into variables.