handling layers & hash