Add test code
Refactoring