Directly working for US company

After getting PR, how to work directly for a US company as a contractor? Do I need to start a company in US and Canada? Has anyone done this? Or is it better to go through a payroll company? I’m trying to avoid paying an intermediary company unnecessarily.

Create a corporation (talk to a CPA)
Get a business bank account
Connect it to Wise (Transferwise), you can give USD ACH routing info to clients.
After that invoice and get paid.
Get CPA to file business returns and figure out how you want to pay yourself (monthly salary only or salary plus annual dividend, with the help of a CPA)