minimized javascript code and removed unused stuffs