break up big function