Refactoring pumgen tool