Better locks that should lead to much cleaner code in the future