- generator code from ngbp fork transfered