move master key synchronization to separate method