Move hook implementations to hooks file.