cash out refi

several years ago I took out a $10k personal loan to pay for some home improvements. In 2022 I took out a cash out refinance with the intention of using the cash out funds for home improvements. Can I use the refi cash to pay off the previous persona;lloan since it was on the same house?