header->setType moved into the constructor of a class