refactored as a step toward a common library