doc + refact