split string parsing into stages