Refactoring of database factory -> preparation for MySQL implementation.