CLOUDIFY-2136 refactoring bug fix