Refactor hooks configuration