[PATCH 4/5] Consolidate periodic handler code