partly refactoring