refactor pluto_parse, add tests