refactor wav3d pyramid