Date fix and refactors