extract hooks definition to base