refactory the class ngin
new version