Removed unused javascripts and cleaned up code