an small refactoring