Use simpler and more robust slug implementation