Update ShareStructure.py to use a data structure instead of ifelse