Size, morphology, and nitrogen impurity location, all of which are all thought to be related to the luminescent properties of detonation nanodiamonds, are determined in several detonation nanodiamond samples using a combination of transmission electron microscopy techniques. Results obtained from annealed and cleaned detonation nanodiamond samples are compared to results from conventionally purified detonation nanodiamond. Detailed electron energy loss spectroscopy combined with model-based quantification provides direct evidence for the sp3 like embedding of nitrogen impurities into the diamond cores of all the studied nanodiamond samples. Simultaneously, the structure and morphology of the cleaned detonation nanodiamond particles are studied using high resolution transmission electron microscopy. The results show that the size and morphology of detonation nanodiamonds can be modified by temperature treatment and that by applying a special cleaning procedure after temperature treatment, nanodiamond particles with clean facets almost free from sp2 carbon can be prepared. These clean facets are clear evidence that nanodiamond cores are not necessarily in coexistence with a graphitic shell of non-diamond carbon.