added ability to define callbacks configuration using ref/fn