refactoring parser from representation