Move common installer setup stuff to a helper method

Hi guys, I solved this TODO extracting common installer setup tasks to a helper method and calling this helper only in required files, all tests are green.

Bests