Optimised saving in repo