make slug generation more robust using regex and string manipulation methods