Refactor fromList.