Refactor to support generation from raw paths