add test
refactoring