Split out parseLine function