VID-1494 some minor refactoring