Cleanup and refactoring for path and operation generation