Performance improvements
Some fixes
Some resend stuff
Note: it is a bit crappy but I will clean it up this week