Wrote more to finalize factory but not done yet