Remove more duplicate code. The only difference between the 3 copies is that this version also includes a success value,