The 2 parsing functions made better