Restructuring the current companies to track several grants and Third party funds

Hello, I would like to get a recommendation on the best way to restructure our current 2 separate companies. I would like to track expenses to their funding sources. We currently have company one from 1 funding source and company 2 is third party funds and money from company 1 designated for certain expenses. There are a total of 6 bank accounts. Would I need to close some accounts and only operate off of 3 or so to be able to reconcile in the system versus on an excel spreadsheet? I would like to setup it up as follows: One checking account, one money market account and one payroll account while being able to track funds to corresponding funding sources. I am just lost at how to do so or if it is recommended. Any input and suggestions are appreciated!