improve time handling a bit