unit test
refactoring code