Refactor creation of pie nodes