minor refactoring for clarification