Added custom exception; extracted superclass from CharacterSet