merge some common code (nw)