use Function.wrap for refining layer activation