Now supports multiple types of hooks, not only 2.