This method starts at line 385. It needs to be broken up.