Could you note here that `repository` may not be nil? Same with the rest of the methods.