CLOUDIFY-1790 Refactoring. moved logics out of the toString override into a build() method