refine build process