refactor parser and transform