Align with UPS 1.0.2.
Refactor duplicated code in Deployments.java.