Redesigned database layer