basic framework for event hooks