fix and clean (by Chenfei)