[All] Formatting and null checks
[All] Use better syncronization primitives