Add roottype logic.