refactored slugs and made more robust sluging