AI-499 : adapted code according to latest Alex's changes