cleaned up resource.js