simplifying javascript file by converting timeline to an object literal