Refactoring defineCVViewVariables()

Signed-off-by: Fabien Crassat <fabien@crassat.com>