use js oo to simplify js file