Refactored code to support supported_characters method