@AshI see. As a fresh idea for your design you may consider using modern capacitive isolators instead of optocouplers. Very convenient, good isolation ratings, logic I/O on both sides, saves a lot of components/board space. Original TI's ISO series used to be expensive, now every major Chinese manufacturer like Chipanalog or 2Pai seems to have an inexpensive clone

With some versions, there is even a luxury of having a tiny isolated DCDC converter right on a chip, be careful at layout though, as they work at really high frequency, some 20-50MHz!