refactoring parser file