Add test for case-imbalanced words
Refactoring