use factory mode for pattern object