CLOUDIFY-1559 refactor