refactor time strftime