refactor wg hook