reorganize key structure