Breaking big function in smaller functions