doc upgrade; code clean