major revamp on db and data layer