structure factory working