now VisualSearch works with ids, done some refactoring