Let me first say that I don't know much about CRA. As far as HMDA goes, I would not consider building a barn on agricultural property to be home improvement, even if there is also a dwelling on the property. Others may disagree.
Therefore, I would not report your first situation (building the barn). I would report the 2nd as a refi for HMDA purposes. We don't get an 'out' with refinancing agricultural property like we do when purchasing it.