more refactoring
extension method on characters
better c# compatibility