delete a block of duplicate code