Add generator, refactor code