Refine cap deploy script