added a private method to generator, added spec/docs