refactored triggers in order model