Lot of cleaning up in the javascript parts