major code refactoring, requires hiera now