Refactor: extract wallet operations