Revised internal hook logic