Implemented Abstract Generator

Complete refactoring to use Abstract Generator.