Refactor and Hooks