doc
refactoring code