refactored breadcrumbs code