project refactoring, add unit test