minimal refactoring