Refactored and wrote test for the case conversion.