thanks to the good people on stackoverflow, I have a more flexible factory AND I learned aboug globals