Refactor trigger logging