Replaced gates with gate factories