Consolidated some code that wasn't DRY.