Database models refactored