make slug generation reusable