minor refactoring round2