I would probably turn both of these into tiny functions with helpful names.