callbacks moved out of the directive