minor refactoring