Refactored delimiter handling