Refactoring for seperating renderer from parser