refactoring:  externalized inner classes