Change core data structure from tree to list