Refactor polypath nodes