Refactoring of sources tab: more encapsulation of pie chart