Created new function which holds code that was identic and used in 2 places before.
Now this function is called instead.