refactoring code about timeline