Replaced closure with factory