add tests case
refactoring