Turning cliques into paths to achieve planarity