zhang250 & zhou86: refactoring and commenting

part of refactoring and commenting