cleanup in js code, and removed some unused resources