Updated wallet to factor out code.