make hook more flexible