fixed hook scaffold and refactor