The way you talked about is for filling as dual status, and leave IRS for a judge. you will still have to problems on how to calculate your personal exempt, and worried whether you are doing right or wrong.
In fact you can file either as 1040NR or 1040.
Most likely, say you have a dependent, then simple file 1040 and give up treaty benefit is in your best interest.
If you are a sigle, then simply file 1040NR.