improve r3_slug_parse function