optimize parsing method