test fix and refactoring
fix and refactoring