Hi,

If you change from PORTB to PORTA you will be loosing interrupts. So might limit the functionality of your system. Why not revise the pull-ups have a clean PS proper freewheeling diodes for the relays and so on