cleaning up stringdelimiter.js function