More trigger function cleanups