Refactored valid characters