clean up and refactor yggdrasil.parser