code reformatting: grouping memory