refactor out passing around timestamp