CANA-1354 #time 1h refactoring some code