migrating structure to widget factory