rebased ot merge common code