Refactoring the DB