partial refactoring