Some changes.
1.Refactoring
2.Bug fix.