implemented to apply callback functions with certain events