Refactor this in a follow-up PR. _Originally posted by @hieblmi in https://github.com/lightninglabs/loop/pull/1043#discussion_r2584176465_