Refactoring of Database-related classes and finalizing table joins.