made layer activation more generic