improvements in abstract factory