refactoring for spare testing