Move sets into functions.

Move tasks into their own functions to make things easier.