Overhaul how paths are created to be more robust