Minor code cleanup for ui event tracking.