Requested by @nezz - moved the shared flag out as a member variable.