update document
refactor variable control