refactored to hide java date nonsense