Refactor parseTimestamp into util module