Implement some extensions and a method to replace bad charactor