refactor for wayii