[#71356442] refactoring

remove unnecessary logic from view

reduced duplication in Graph methods

Signed-off-by: Martha Berner <marthaberner.mb@gmail.com>