Refactoring
Add unit test