refactoring timeline widget