Cleaned up some code.

Signed-off-by: Xiaomao Chen <xiaomao5@live.com>