DOC + remove duplicated code