Transformations in inorganic nanomaterials: role of defects, surfaces, and size