CLOUDIFY-2217 refactoring