a small refactoring