Is there an aspect-oriented library we can use to make these hooks standard?

Other than that this code is perfect.