Refactored to be able to have a custom timestamp