[Trib] borrowed relevant content from Tribbler