refactor w3