added test case
refactoring