add test and refactoring
update usage