CLOUDIFY-1660 fix checkstyle and some minor refactoring