add test
refactor