Tidy up parser to actually work