improve waf structure