refactoring. some method added.