Refactored TimelineRepository.java and related classes