modified the codes struct from xxx.prototype.method to xx.prototype = {method:xxx}, and some other code styles