Splitted selection listeners into two classes, added middleware layer and minor changes to DataManager class.