IO expander alternative

until i get a machine to mill pcbs i dont have much choice in the matter. i seen mosfets,diodes,optocouplers and said ill take my chance. i bought the red ones to destroy and run torture tests on. i think the green ones are much better quality. if this was a single mosfet project then i would absolutely build it. i actually have mosfets to build one i was just feeling lazy. I wont even have to reprint my enclosures with the green ones, the drop in right where the relay modules sit. with @chrisknightley solution, i dont even have to change the HIGH,LOW logic in the code for to work properly anymore.