fix build path and codes optimization