Improved the thread safety of the shared instances by using GCD dispatch_once tokens.