improved trigger creation