refactored repository.php - extracted specifics