refactor wave helpers