improved performance and add ParseString