refactor metadata access
rename confusing AllocatedSize to AllocatedDataSize