refactoring single cell next generation function