refactor resizePizzas function