Changed to Dispatch_Once macro and some sample code improvements