On the origin of internal layers in comet nuclei