Refactored timeline and fixed the layout problem