adding moment for date format and re-structure main