stuffed some of the functionality back into parser