Refactor to remove bug in pizza to dict and reduce