VID-2079 adding comments and more code cleanup