Refactor to not use generator.  Not working yet in new setup