CLOUDIFY-1595 more refactoring