Refactor the way hooks are stored