reorganized the deploy part