Refactor for hiera support