Perhaps it'd make more sense to use a proc here?