Reduce duplicated code by adding a function to create repo list items.