Surface energy and structural heterogeneity of crystal-forming media