Refactoring of sources tab: extracting some methods to make things more clear