Remove swath of duplicate code