modularized event_trigger into functions for portabiltiy