Refactoring, add hook option