Added selector class and adapted existing code.

Signed-off-by: matematik7 <domen.ipavec@z-v.si>