minor refactoring for readability