Refactoring.

 - Silence the warning.
 - Remove obsolete codes.
 - Fix warnings.