Add Factory pattern.