Re-writing Timeline JS to object and instance