Migrate old codes from http://dodysw.googlecode.com/svn/trunk/