Refactor timestamp