RFCT+DOC Document & simplify code