Refactoring of puppet plugin