Refactor: move code to get_references()
Use Group object
Refactor: move code do have_shared_base()
Record base
Show base of each group
Sort items