refine source code