TestCode Refactoring