Eliminating duplicated code on subcategory repository.