refactoring
add test