Refactoring and adding new database handlers.