Just bought a 25 yr old house with a deck that needs replacing. The old deck joists which need to be removed go through the houses brick facade and are presumably attached to the rim joist.

How do I remove/treat these old deck joists? Do I need to chisel them out and fill the void with mortar or can I cut them off flush and use flashing to prevent water and critter infiltration? My concern with the second method is that eventually the cut off joist will rot away under the flashing providing large accesses to the inner structure that bugs and possibly rodents may use to get inside.