refactored trigger, simplified