[TriggersView][LatestView] Extract callback related code as a new function "setupCallbacks()"