Engineering cell-based factories