Re-wrote how internal hooks are initialized.