Factorying out TimeLine class and general tidy up