A mortgage lender can only charge interest or fees on the amount of funds that they financed.  If the new mortgage company is giving you some cash as part of the refinance, you will only owe fees to the new mortgage company per your agreement with them.