Refactor generators to inherit from common ancestor