trying to apply a factory pattern.... and failing