Move logic out of create_share_structure to increase readability