Refactor the Puppet plugin