parameterize the struct factory