Puppet master refactor