add pattern of factory