Answer:
Split the Government into a Diarchy type situation
The Emperor leads Domestic Affairs, while the Shogun leads Military affairs within japan, create a parliament full of the daimyo so that internal politics becomes easier, and have the samurai act as Guards for important people in government.
This is just a brief idea, and the Shogun would likely just take back control, although I believe you can provide the checks and balances.