clean up resource code