refact factory