first refactoring structure of class, make proto, and reform function in proto