refactored parts of the database
resolving merge conflicts