adjusted references from globals to target structure