Refactoring around private repo error messages