Refactoring word test case