closing feature #5362 made some code improvements