Multi loss

You're duplicating a lot of code here, is there a reason the same code can't be used for both single loss and multi loss?