Clean up nested prefix generation