Fix date format for Firefox
Change format a bit
Some cleaning up of the code