flattened nested structure, fixed some typos