DRYed up some things