Reduced duplicated code
Simplified parameter passing
Allow numeric timestamps