smarter delimiter logic