VID-1907 Simplify conditional code