Polishing and cleanup

It's quite a lot more stable now