There's a lot of duplicated code here... maybe add a helper? Or is there enough variation that it's not worth it?