Updating hooks API to use hook objects (#1)