Paying the taxes on your 401k withdrawal can take away a lot of money. You can try to avoid some of the taxes with the immediate taxes. You can choose to allocate the after-tax funds into your retirement plan to the Roth Ira and then the pre-tax funds into the traditional IRA.
You can also choose to split up the retirement money into two accounts. This will reduce the immediate tax impact and possibly save you some money. Seeing a tax attorney or accountant will help you make the right choice.