Some cleanup with hooks and tasks.