remove resource variables and functions from the global scope