extract the generator&checker into a new module