Templatize Scoped_atom2 to take any resource.