Some parser logic, may not work quite right.