fix multiple lwf, and code reformat.