refactoring delimiter handling