Refine the buildbox script