refactor doMortgage