changed the idea of Selector library - a lot of changes