refactor puppet structure to be more modular