Nanocrystal formation in homogeneous and heterogeneous amorphous phases