improve the String method performance