refactored entity storage schema