Refactor code for the public_data check on an object
Remove a few unnecessary asserts